fix the clusterer for boundary conditions and do not absolute the distance