new particle filter code from online it works pretty well