working on undo functionality in object class