removed all trailing whitespace and mixture of space and tabs
using === to compare to 0
updated another comparison to 0 to ===
added missing semicolons
removed repeated var declarations
using !== to compare to null and removed repeated var declaration
define radix for parseint
ensure vars are declared out of loop and are not out of scope