Code samples referenced in my blog at www.chrislormor.com