main trying, errors on matrix assembly