Added much of the basic functionality to the Matrix class.