implemented validBet as pure function