Made all variable names have the same style, fixed some typos in comments