updated variables and flow