Implemented Undo and Redo functions

Implemented and tested Undo and Redo functions!!! Yay!