added examples, fixed bug in example