working on ratings query