Made readPipe() faster