fixed a bug with closeness calculation