added when.php and updated if.php