Step 5: Create the link function