Added ability to calculate the rate locally.