fixed distmatrix interface