Added outline of optimization code.