separate input and output