Added an option to pop the last node, removing it from the stack