coef calculation