Include a state machine on the main to have more control over the different phases
Include a state machine on the main to have more control over the different phases