Added materialRating method and moved rating() to it's own class.