Basic design of the matrix class