script added for calcul automatic