Update Main code