Added examples, and more flexible API