Updated template.php