Modified to take URL and file