Parse_when fnc