input and output works