multiple changes to clustering routines