Optimization in C