sample code moved to sample.php