Added functions that read in the redirected input.