update example scripts to use the newer interface