Improved cutoff function.