moved links to function