extended EventEmitter functionality
added an working example