added events to allow for binding to certain things. updated demo to reflect this.