Make clustering code accept additional parameter