changed hashmap back to a sorted map