update examples and add test