Events module

Working events module. Fixed the escape function.