adjusting the tests and removing addEvent function