Added in stub optimize function