fix some bugs and begin a small example