Fixed bug in stack class.
Updated main class.