Added flow chart for main functionality