function buyTopDog(uint buyprice, uint surplus) private {

		
		uint vfee = buyprice * visionDogBuyPercent / 100;

		uint dogpayoff = (buyprice - vfee);

		
		topDog.send(dogpayoff);

		visionFees += vfee;

		
		visionDog.send(visionFees);
		visionFees = 0;

		
		
		topDogPriceFloor = topDogMinPrice;

		
		topDogMinPrice = msg.value * topDogMinMarkup / 100;

		
		topDogPriceCeiling = topDogMinPrice;


		

			


			


		

		
		underDogMarkup = 150;

		
		uint linelength = Underdogs.length - payoutIndex;

		
		


		
		if (surplus > 0 && linelength > 0 ) {
			throwScraps(surplus);
		}


		
		if (linelength > 0) {

			

			
			
			
			
			
			

			
			
			

			uint luckypickline = (linelength % 2 == 1) ?
				( linelength / 2 + 1 ) + (linelength + 1) * (linelength / 2) :  
				( (linelength + 1) * (linelength / 2)  ); 

			uint luckypick = randInt(luckypickline, 69);
	
			uint pickpos = luckypickline - linelength;
			uint linepos = 1;

			while (pickpos >= luckypick && linepos < linelength) {
				pickpos -= (linelength - linepos);
				linepos++;
			}

			luckyDog = Underdogs.length - linepos;
		} else {
			
			
			luckyDog = 0;
		}
		

		
		topDog = msg.sender;
	}