closeness code added.