Time for action – coding the main loop