added printSolution method