building a stack with push and pop