Minor changes to param names and order of code