some slight improvements made to optionparser