Set up navigation logic