Implemented rates calculation