added sorting to the results map