Code for final project particle filter