refactor average_rating function
Merge pull request #4 from Frenzy277/mod2

refactor average_rating function