A matrix class