fixed a boundary condition on clustering