Add python 3.2 support. fix reading from input file