tminres running successfully with largematrix, code still buggy.