Add in a randomised partition function