corrected spelling and variable identifier mistakes