added a matrix class