Update main code