Additions to matrix class