Chapters 1 & 5 Code Listings