updated rating algorithm in javascript and in the functions.php file so input xy rating and output xy percentages are accurate