turned two queries into one and added sorting
some tidying up still need to do some tests