Create optimizeNetwork