updated input and output