Update logic.php