I think $rate should be $result here