printSolution() function added