Added AffineVals and modified solver accordingly