updated to read a file or a URL from command line