Add a matrix class