added undo functionality to object class with tests