refactoring using new generator. fixed click event handling. updated demo