Work on countSolutions