Add events.js from ch10