The end_input function