added logic for navigation and answer check