Written by Orion Lawlor (olawlor@acm.org) 2005. Public domain.