removed unnecessary pattern matches in the definition of stack operations
shortened sequence generation