Switching over to map functionality. Sorting does not work