Adding the solution to problem 23...