changed pipes from FILE to descriptors