Adds main method.