Uncommented several lines of code in main event loop