MAIN PHP UPDATED