Added link detector code