added in more events code
fixed conflicts