Working version, cannot get past file descriptor limits in Mac OSX