added navigation controller, refactored