Added spaces to make code more readable and slight changes to a couple variable names