separated declarations and assignments
use function declarations
created jslintrc and removed hints from js files