created flowchart, fixed a typo in comments