some declaration
smoothing almost done, need to calibrate rise time
second way to smooth
finalized smoothing function