- added keyboard handling code.
- did some refactoring of filenames