updated Main.php and other