fixed bug in argparse handling: now accepts input from file as well as stdin.