added smooth_files function for spm