How does Optimization work?