updated flow chart