cleaned up the code, added flowchart to project.