update frac_demo.cpp for stream input