@Override
	public boolean isTerminal(GameState gameState) {
		boolean[][] bitSets = gameState.getOccupancyMatrix();
		boolean isDraw = true;
		for(int i=0; i<bitSets[0].length;i++){
			if(gameConfig.findTopIndex(bitSets, i)!=-1)
				isDraw = false;
		}
		if(isDraw)
			return true;
		
		List<boolean[]> list = new LinkedList<boolean[]>();
		list.addAll(getRowBitSets(gameState.getBlackBlocks()));
		list.addAll(getColumnBitSets(gameState.getBlackBlocks()));
		list.addAll(getDiagonalBitSets(gameState.getBlackBlocks()));
		for(boolean[] tempArray : list)
			if(checkForContiguousBlock(tempArray))
				return true;
		
		list = new LinkedList<boolean[]>();
		list.addAll(getRowBitSets(gameState.getWhiteBlocks()));
		list.addAll(getColumnBitSets(gameState.getWhiteBlocks()));
		list.addAll(getDiagonalBitSets(gameState.getWhiteBlocks()));
		for(boolean[] tempArray : list)
			if(checkForContiguousBlock(tempArray))
				return true;
		
		return false;
		
	}