# logic for instantiating variable colorkey input 
	if not colorkeyfields == False:
		colorkey = 'selectedText'

def make_bindings_type(filenames,color_input,colorkey,file_dictionary,sidebar,bounds):
	# instantiating string the main string block for the javascript block of html code
	string = ''

	'''
	# logic for instantiating variable colorkey input 
	if not colorkeyfields == False:
		colorkey = 'selectedText'
	'''

	# iterating through each geojson filename
	count = 0
	for row in filenames:
		color_input = ''
		colorkeyfields = False
		count += 1
		filename = row
		zoomrange = ['','']
		# reading in geojson file into memory
		with open(filename) as data_file:    
   			data = json.load(data_file)
   		#pprint(data)

   		# getting the featuretype which will later dictate what javascript splices are needed
   		data = data['features']
   		data = data[0]
   		featuretype = data['geometry']
   		featuretype = featuretype['type']
		data = data['properties']


		# logic for overwriting colorkey fields if it exists for the filename 
		# in the file dictionary
		try:
			colorkeyfields = file_dictionary[filename][str('colorkeyfields')]
		except KeyError:
			colorkeyfields = False
		except TypeError:
			colorkeyfields = False

		if not colorkeyfields == False:
			if len(colorkeyfields) == 1:
				colorkey = colorkeyfields[0]
				colorkeyfields = False

		try:
			zoomrange = file_dictionary[filename][str('zooms')]
		except KeyError:
			zoomrange = ['','']
		except TypeError:
			zoomrange = ['','']



		# code for if the file_dictionary input isn't false 
		#(i.e. getting the color inputs out of dictionary variable)
		if file_dictionary==False and colorkey == False:			
			# logic for getting the colorline for different feature types
			# the point feature requires a different line of code
			if featuretype == 'Point':
				colorline = get_colorline_marker(color_input)
			else:
				colorline = get_colorline_marker2(color_input)



		# setting minzoom and maxzoom to be sent into js parsing 
		minzoom,maxzoom = zoomrange

		# getting filter file dictionary if filter_dictonary exists
		if not file_dictionary == False:
			filter_file_dictionary = file_dictionary[filename]
		else:
			filter_file_dictionary = False 

		# checking to see if a chart_dictionary exists
		try: 
			chart_dictionary = filter_file_dictionary['chart_dictionary']
		except KeyError:
			chart_dictionary = False
		except TypeError:
			chart_dictionary = False


		# sending min and max zoom into the function that makes the zoom block
		zoomblock = make_zoom_block(minzoom,maxzoom,count,colorkeyfields,bounds,filter_file_dictionary)

		# logic for if a color key is given 
		# HINT look here for rgb raw color integration in a color line
   		if not colorkey == '':
   			if row == filenames[0]:
   				if colorkey == 'selectedText':
   					colorkey = """feature.properties[%s]""" % colorkey
   				else:
   					colorkey = """feature.properties['%s']""" % colorkey
   			if featuretype == 'Point':
   				colorline = get_colorline_marker(str(colorkey))
   			else:
   				colorline = get_colorline_marker2(str(colorkey))


   		# this may be able to be deleted 
   		# test later 
   		# im not sure what the fuck its here for 
   		if file_dictionary == False and colorkey == '':
	   		if featuretype == 'Point':
	   			colorline = get_colorline_marker(color_input)
	   		else:
	   			colorline = get_colorline_marker2(color_input)
   		if colorkey == '' and colorkeyfields == False:
	   		if featuretype == 'Point':
	   			colorline = get_colorline_marker(color_input)
	   		else:
	   			colorline = get_colorline_marker2(color_input)

   		# iterating through each header 
   		headers = []
   		for row in data:
   			headers.append(str(row))

   		# logic for getting sidebar string that will be added in make_blockstr()
   		if sidebar == True:
   			sidebarstring = make_sidebar_string(headers,chart_dictionary)
   		else:
   			sidebarstring = ''

   		# section of javascript code dedicated to the adding the data layer 
   		if count == 1:
	   		blocky = """
	function add%s() { 
	\n\tfunction addDataToMap%s(data, map) {
	\t\tvar dataLayer = L.geoJson(data);
	\t\tvar map = L.mapbox.map('map', 'mapbox.streets',{
	\t\t\tzoom: 5
	\t\t\t}).fitBounds(dataLayer.getBounds());
	\t\tdataLayer.addTo(map)
	\t}\n""" % (count,count)
		else:
			blocky = """
	function add%s() { 
	\n\tfunction addDataToMap%s(data, map) {
	\t\tvar dataLayer = L.geoJson(data);
	\t\tdataLayer.addTo(map)
	\t}\n""" % (count,count)
		
		# making the string section that locally links the geojson file to the html document
		'''
		if not time == '':
			preloc='\tfunction add%s() {\n' % (str(count))
			loc = """\t$.getJSON('http://localhost:8000/%s',function(data) { addDataToMap%s(data,map); });""" % (filename,count)
			loc = preloc + loc
		else: 
		'''
		loc = """\t$.getJSON('http://localhost:8000/%s',function(data) { addDataToMap%s(data,map); });""" % (filename,count)			
		# creating block to be added to the total or constituent string block
		if featuretype == 'Point':
			bindings = make_bindings(headers,count,colorline,featuretype,zoomblock,filename,sidebarstring,colorkeyfields)+'\n'
			stringblock = blocky + loc + bindings
		else:
			bindings = make_bindings(headers,count,colorline,featuretype,zoomblock,filename,sidebarstring,colorkeyfields)+'\n'
			stringblock = blocky + loc + bindings
		
		# adding the stringblock (one geojson file javascript block) to the total string block
		string += stringblock

	# adding async function to end of string block
	string = string + async_function_call(count)

	return string