Sample code for chapter 1 of my book Taming the Bad Code.