Added code for main loop