finished particle clustering draft coding