some cleanup and small features:
  - track button presses
  - exit gracefully on KeyboardInterrupt
  - docstrings