added stack and state objects