added example code, ref #27