updated tp.php