added testing function for stack.py