Slight refactoring/bug fix for optimalWinWagers