sample code that works with new phrets.php