added function to find average ratings