Added flowchart, updated README and finalized code