update input & output method