added matrix distance exaple as a test