fixing some examples and bugs