Improved example, fixed small bug.