modified function to write eventsfile.
Merge remote branch 'origin/master'