Add tests using matrices