updated example program for #2