added a few more logic for LotteryMath