update examples and add comments, fix on_behalf_of generation