Don't double-declare @sorted.