fix input and output