Final commit with updated commenting and flowchart.