Main flowchart control change

Syntax errors and restructuring the control code priority.