CS373: better particle filter

* Restructres elements.

* Fixes various bugs including weight appenditure.