Adjusted variable names and typos for spelling.