Got main loop to compile correctly