Now reads either from a file argument or through stdin.