Cleans up code a bit, removes spelling errors. Also updates variable names to better conform to Go standards.