Added another solution to exercise 2.4.