updates some variables;