Updated bets and fixed average function