optimization begins