cleanup, but possibly broken
added examples, documentation improvement