added examples and bug fixes