rewrote the main flowchart to show functions instead of returns.