updated matrix class so we can implement linear solution