input and output added