errors in dirac_opt is fixed