updated the flowchart