renamed some variables
fixed some misspellings