Added comments to imports
Added infinite loop break, changed order of main loop