implemented sequential importance resampling