Have you deliberately left the redundant `sort` calls in here for the sake of consistency?