Implemented undo functionality (fixed size)