better Makefile
fix array bounds bug
obey number of screen lines (getmaxyx())