I'm getting JSLint errors in this file, such as: 'writeResults' was used before it was defined.