First working version. Added example code