implements demonstration example, for us in documentation
this is why coffeescript is better