adding file input and output