public void setupOverlay(Hashtable<String, Connection> connections)
	{
		//add all nodes to graph
		addNodesToGraph(connections);
		
		List<Connection> connList = new ArrayList<Connection>(connections.values());

		//first iteration
		for(int i = 0; i < connList.size(); ++ i)
		{
			int destinationIndex;
			if(i == connList.size() - 1) //if this is the last node
			{
				destinationIndex = 0; //sets to first node
			}else
			{
				destinationIndex = i + 1;
			}

			//create request and specify random link weight
			int linkWeight = (int)(1 + Math.random() * (10));
			LinkRequest linkRequest = new LinkRequest(connList.get(destinationIndex).getIP(), connList.get(destinationIndex).getListeningPort(), linkWeight);

			//add edge to graph
			System.out.println(connList.get(i).getIP() + connList.get(i).getPort());
			Vertex source = _graph.getVertex(connList.get(i).getIP(), connList.get(i).getPort());
			System.out.println("Source: " + source);

			System.out.println(connList.get(destinationIndex).getIP() + connList.get(destinationIndex).getPort());
			Vertex destination = _graph.getVertex(connList.get(destinationIndex).getIP(), connList.get(destinationIndex).getPort());
			System.out.println("Dest: " + destination);
			
			_graph.addEdge(new Edge(source, destination, linkWeight));
			
			//send data
			try
			{
				connList.get(i).sendData(linkRequest.getBytes());
				TimeUnit.MILLISECONDS.sleep(20);
			}catch(IOException ioe)
			{
				ioe.printStackTrace();
			}catch(InterruptedException ie)
			{
				ie.printStackTrace();
			}
		}

		//second iteration
		for(int i = 0; i < connList.size(); ++ i)
		{
			int destinationIndex;
			if(i == connList.size() - 2) //if this is the second to last node
			{
				destinationIndex = 0;
			}else if(i == connList.size() - 1) //if this is the last node
			{
				destinationIndex = 1; //sets to first node
			}else
			{
				destinationIndex = i + 2;
			}

			//create request and specify random link weight
			int linkWeight = (int)(1 + Math.random() * (10));
			LinkRequest linkRequest = new LinkRequest(connList.get(destinationIndex).getIP(), connList.get(destinationIndex).getListeningPort(), linkWeight);

			//add edge to graph
			Vertex source = _graph.getVertex(connList.get(i).getIP(), connList.get(i).getPort());
			
			Vertex destination = _graph.getVertex(connList.get(destinationIndex).getIP(), connList.get(destinationIndex).getPort());
			
			_graph.addEdge(new Edge(source, destination, linkWeight));
			
			//send data
			try
			{
				connList.get(i).sendData(linkRequest.getBytes());
			}catch(IOException ioe)
			{
				ioe.printStackTrace();
			}

		}
	}