changed input and output