refactoring into directories; better makefile; work on keypress