Refactoring.
Removed duplication from sequence generation and merge/superimpose