Alternate approach to exercise 3.28 (using hint)