methods now handleInput and handleOutput