added merging with particle filter code