gothonweb from http://learnpythonthehardway.org/book/ex50.html