argopt -g optional

* improved argument structure
* and boundry check