added input and printing