Passes JSHint. Added missing semi-colons, prevented redeclaration
of vars. Added additional spacing for consistency.