Added simple optimization.