add examples and bug fixed