Reordered function parameters to make the code easier to read.