Added rating logic.