stdin & stdout, the right way