add missing semicolons and parentheses