corrected some variable names.