everything hacked together and working, except in IE10 because IE10 does not have CustomEvent. onto refactoring