a naive matrix class