Cleaned-up and validated the JS.