grouping markets together and sorting by price