keyboard shortcut for Undo, plus gratuitous use of ternary operator