Update med and mad calcul, put calcul in utilities file