Adding function to extract links