Renamed some parameters to make it more obvious what they are.