cleaned up code and added json data and flowchart