Prepared the code for smoothing.