An implementation of http://xkcd.com/936/