function above^^^
		
		
		
		
		

		
		uint256 tokenBalance = balances[msg.sender];
		
		require(_amountTokens <= tokenBalance 
			&& contributionTime[msg.sender] + WAITTIMEUNTILWITHDRAWORTRANSFER <= block.timestamp
			&& _amountTokens > 0);

		
		
		uint256 currentTotalBankroll = getBankroll();
		uint256 currentSupplyOfTokens = totalSupply;

		
		uint256 withdrawEther = SafeMath.mul(_amountTokens, currentTotalBankroll) / currentSupplyOfTokens;

		
		uint256 developersCut = withdrawEther / 100;
		uint256 contributorAmount = SafeMath.sub(withdrawEther, developersCut);

		
		totalSupply = SafeMath.sub(currentSupplyOfTokens, _amountTokens);

		
		balances[msg.sender] = SafeMath.sub(tokenBalance, _amountTokens);

		
		DEVELOPERSFUND = SafeMath.add(DEVELOPERSFUND, developersCut);

		
		msg.sender.transfer(contributorAmount);

		
		emit CashOut(msg.sender, contributorAmount, _amountTokens);

		
		emit Transfer(msg.sender, 0x0, _amountTokens);
	}

	
	function cashoutEOSBetStakeTokens_ALL() public {

		
		cashoutEOSBetStakeTokens(balances[msg.sender]);
	}

	
	
	
	
		
		
		
		
		
		
		
		
		
		
		
		

	function transferOwnership(address newOwner) public {
		require(msg.sender == OWNER);

		OWNER = newOwner;
	}

	function changeWaitTimeUntilWithdrawOrTransfer(uint256 waitTime) public {
		
		require (msg.sender == OWNER && waitTime <= 6048000);

		WAITTIMEUNTILWITHDRAWORTRANSFER = waitTime;
	}

	function changeMaximumInvestmentsAllowed(uint256 maxAmount) public {
		require(msg.sender == OWNER);

		MAXIMUMINVESTMENTSALLOWED = maxAmount;
	}


	function withdrawDevelopersFund(address receiver) public {
		require(msg.sender == OWNER);

		
        EOSBetGameInterface(DICE).payDevelopersFund(receiver);
		EOSBetGameInterface(SLOTS).payDevelopersFund(receiver);

		
		uint256 developersFund = DEVELOPERSFUND;

		
		DEVELOPERSFUND = 0;

		
		receiver.transfer(developersFund);
	}

	
	function emergencySelfDestruct() public {
		require(msg.sender == OWNER);

		selfdestruct(msg.sender);
	}

	
	
	

	function totalSupply() constant public returns(uint){
		return totalSupply;
	}

	function balanceOf(address _owner) constant public returns(uint){
		return balances[_owner];
	}

	
	
	function transfer(address _to, uint256 _value) public returns (bool success){
		if (balances[msg.sender] >= _value 
			&& _value > 0 
			&& contributionTime[msg.sender] + WAITTIMEUNTILWITHDRAWORTRANSFER <= block.timestamp
			&& _to != address(this)){

			
			balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
			balances[_to] = SafeMath.add(balances[_to], _value);

			
			emit Transfer(msg.sender, _to, _value);
			return true;
		}