matrix exercise with unit test; at least tried