adds main code