I modified the program to use stream mode