adding internal clustering