Untested, but theoretically working version of the possible wins function