Code for indentifying and connecting particle clusters