corrected some calcul errors