fix sorting (newN)