update main code