Added keypress navigation and code cleanup