Removed logic from index.php, added logic.php