Code for Part 8 of the tutorial series