Sample code for Particle Filter algorithm