Changed the sequence generation