second attempt at link generation