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