rates are now working, with different functions built in