some changes to pipe logic
some prototypes for input and output redirection