implemented sort by rating