CS 240: added missing for loop to example 4.5 (thanks Xianhe).