Add a case for sorted results