Tweaked problem 3.