more changes to combinatorial.py
finally fixed clustering routines