first fix attempt for numpy sort