Updated flowchart