update library and example code to use iterator expressions