casting wasn't correct for smoothing, and was smoothing wrong data