fixed error in solveA1 and solveA2