now reads files based on filename given in argv, otherwise expects input via stdin