fixed the logic of calculating ratings again