made some adjustments for updating average rating, fixed search test to ...

...be dynamic, and implemented sorting for rating/name
added a check. is there a preferred way?