Added a little event handling and an example