add more examples, fix some bugs