Added findSolution function.