begun adding time correction and smoothing