implementation of kalman which can deal with non-valid data points added