implemented undo with shift