Implemented undo stack that saves end results (must implement operation saving too),but have to improve input functionality.