Fixed the main loop after Kirk broke it