Code sample I wrote in January 2011.