improve sequence generation