Updated index.php and logic.php