modifies cluster algorithm