finalized flow chart