Added sort and fixed closings of input pipes. added null pointers to some execlp