JSLint passing. Reorganized code.