added example + bug fixes