First version of Matrix class.