added a working version of my example

and fixed some stuff