added real opt support