removed unnecessary var declaration
added a few missing semicolons
removed a few unused variables