Refactor some functions
Merge branch 'master' of https://github.com/bingoyahoo/ParticleFilter