https://github.com/MoseleyBioinformaticsLab/visualizationQualityControl/blob/5522fa8e1c3328be11a28f0b67f73e08e078ee3f/src/kendallc.cpp#L114 I sent a DM about this, but I think this is more "neat".