final example and some little bug fixes