Slowly building up the main routine.