adds examples, and a few other fixes