corrected betting algorithm