Created by: emailweixu
Sequences should be sorted according to the number of subsequences they have.
Also added print_layer for debugging.