fig 3.4 source code