testing event buffer, cleaning up code