Implementing Matrix test.