matrix class updated.