initial script and sample input file from http://norvig.com/pal17txt.html