refactoring

- turn more integers into booleans
- remove extraneous space after non-colon prompt
- use key parameter with sort