fixed up the cohesion and separation algorithms to use a threshold