fix to distance matrix shape

Signed-off-by: Zarrar Shehzad <czarrar@gmail.com>