Defining the input and output functions