`sorted()` can take an iterator so I don't thing you need the `list()` in there too.