Updates to code in various chapters