Add routines to chapter 3