created nav function