fixed spelling error and duplicate variables