add simple examples and correct some bugs