modified NPuzzlerSolver.java