Sorted the results dict by the messages field