The second iteration of the undo button implementation