added capability to take input and output