update input and output