refactored navigation to function, still debugging
navigation is now a function
functions for querying subjects and pages