First version of the rating algorithm