Figure 6: The data flow of the main state machine.