added examples, and fixed more bugs