states now work on a stack