main code update