finish building navigation function of template library