Diversification is a core risk management strategy. This is when risk capital is spread across risk sources minimising the variance of expected return on capital. In that setting, we often think about ways of allocating risk capital optimally. The most common approach is the one defined by John Larry Kelly, Jr. that gave birth to his famous Kelly Criterion. This article describes an algorithm which solves for an optimal allocation in his framework. It supports the general case of multiple simultaneous and independent bets with multiple exclusive outcomes.