removed debug code from main loop