Creating redirect_in and redirect_out. Fixing issue with opening non existant files.