adding opt_definition and tests