fixed a bug; added example