fixed example program for new api