added undo / redo functionality to demo. Still needs to be tested.