calculate delta