cleaned up MatrixBuilder class