added dict sorting to messages script