Adds main code