Optimization of the smoothNI function for great N.