Added link recognition function