Implemented stacks without mutation