First iteration of the undo button implementation