Changes in the main loop implementation.