added pre computer distance matrix implementation
matrix test