Further improvements to the rate function