function checkIfWon(uint _currentQueryId, uint _randomNumber) private {
    bool win;
    if (_randomNumber != 101) {
      if (queryIdMap[_currentQueryId].low) {
        if (_randomNumber < 51) {
          win = true;
          sendPayout(_currentQueryId, subtractHouseFee(queryIdMap[_currentQueryId].betValue*2));
        } else {
          win = false;
          sendOneWei(_currentQueryId);
        }
      } else {
        if (_randomNumber > 50) {
          win = true;
          sendPayout(_currentQueryId, subtractHouseFee(queryIdMap[_currentQueryId].betValue*2));
        } else {
          win = false;
          sendOneWei(_currentQueryId);
        }
      }
    } else {
      win = false;
      sendRefund(_currentQueryId);
    }
    logBet(_currentQueryId, _randomNumber, win);
  }