Fixed Main Loop