Added more checks.
Upgraded to take a URL as input.