sort hashes before we iterate over them