Fixed a problem with the smoothing function. And the program speed has
been enhanced.