looping throught links