fixed bug in ClosenessFunction