implemented SFO optimization