removed dependency on element.classList to accomodate older browsers