changed the return type of the getRating to double