Step 6: Use the navigate function to move between pages