refactored rating to implement comparable