Added locateLinks function