Fixing nav typo
Refactoring JS