Updated the ratings calculator. The functionality is the same, but the code is much improved.