create functions for child's manipulations to pipe
put child's manipulation into own function