Unless I'm mistaken, the `sorted` calls are no longer necessary.