Work on clustering

- corrected a bug in the algorithm...
- clustering now is more precise, but complexity arises (no visible slowing of the algorithm)