Updated to pass JSLint