fix bug
more flexibility
update examples