1) moved setup code into a different file. 2) got cursors working along with sort by ratings. Obviously this will break if ratings changes too often