Added recursive algorithm for winner decision.