added example 3; minor changes to example 2