Added missing semicolons. Fixed variable defined twice bug.