added printouts
fixed stream gobble bug