Added all case statements in flow function