Modified code to output URLs