added example with objects