corrected some numerical errors