added internal helper function
added events
added event listener example
added code format to readme