changed location of function calls