The default thing when sorting on a tuple is to sort on the first element. 
So you can just write
```hits = sorted(hits.items())```