stack.cpp updated