public EvolvingGraph replaceNode(int nOut, int nIn){
		EvolvingGraph graphIn = new EvolvingGraph(sample);
		if(nIn > original.getNumOfNodes() || nOut > original.getNumOfNodes())
			fail("Node numbers given should be between 0...NNodes-1");
		if(sampledNodes.indexOf(nOut) == -1)
			fail("The node to be taken out does not exist in the sampled graph");
		int nodeID = sampledNodes.indexOf(nOut);
		//Remove all edges that have one side in the node to be taken out
		Edge uv, vu;
		//int nRemoved = 0;
		for(int i = 0; i < sampledNodes.size() ; i++){
			uv = graphIn.getEdge(i, nodeID);
			vu = graphIn.getEdge(nodeID, i);
			if (uv != null && vu != null) {
				graphIn.removeEdge(i, nodeID, uv);
				graphIn.removeEdge(nodeID, i, vu);
				uv = null;
				vu = null;
				//nRemoved++;
			}
		}
		//System.out.println(nRemoved + " Edges Removed");
		//nRemoved = 0;
		// Add new node
		//sampledNodes.set(nodeID, nIn);
		// Update Edges
		Schedule sched, schedc;
		for(int i = 0; i < sampledNodes.size() ; i++){
				uv = null;
				vu = null;
				sched = new Schedule();
				schedc = new Schedule();
				uv = original.getEdge(sampledNodes.get(i).intValue(), nIn);
				vu = original.getEdge(nIn, sampledNodes.get(i).intValue());
				if (uv != null && vu != null) {
					sched = uv.getSchedule();
					schedc = vu.getSchedule();
					graphIn.createEdge(i, nodeID, sched, 0);
					graphIn.createEdge(nodeID, i, schedc, 0);
					//nRemoved++;
				}
		}
		//System.out.println(nRemoved + " Edges Added");
		return graphIn;
	}