Total overhaul to flowchart. probably still needs changes.