much more efficient way of differencing time