moved main loop, changed makefile