fightfxj's code for <learn python the hard way>