dionOpt function added