Generalises kernel to allow multiple documents per thread