Added a full working version of Undo/Redo (element intaraction)