main code