added support for button events
added documentation