First stab at particle filtering (probably still has bugs)