Please fix the "Solve" function so that it does not hit an ArrayIndexOutOfBounds exception when it is used.