Added ability to read either from file or from url