fixed bug to calculate distmatrix at rand index only