finished up upgrade to template_function.php