sorting out top nav and tidying some code formatting