optimization calculate