Corrected order of parameters in function definition