Changed splitting criteria to be color distance based