- mainopt has to be defined