Fixed the particle bin and shortened code