added subsorting to rating sorting