updates to logic.php