Solution to Problem 10
More comments added