working on optimizing some of the JS

ad code, specifically