public boolean setup(int bindPort, String bootAddress, int bootPort) throws Exception
	{
		 // Loads pastry settings
	    Environment env = new Environment();

	    // disable the UPnP setting (in case you are testing this on a NATted LAN)
	    env.getParameters().setString("nat_search_policy","never");
	    
	    try 
	    {
			// the port to use locally
			int bindport = bindPort;
			  
			// build the bootaddress from the command line args
			InetAddress bootaddr = InetAddress.getByName(bootAddress);
			int bootport = bootPort;
			InetSocketAddress bootaddress = new InetSocketAddress(bootaddr,bootport);
			
			// Generate the NodeIds Randomly
		    NodeIdFactory nidFactory = new RandomNodeIdFactory(env);
		    
		    // construct the PastryNodeFactory, this is how we use rice.pastry.socket
		    PastryNodeFactory factory = new SocketPastryNodeFactory(nidFactory, bindport, env);
		
		    // construct a node
		    PastryNode node = factory.newNode();
		    _pastryNode = node;
		    
		    
		    // construct a new MyApp
		    PastryApp app = new PastryApp(node, this);    
		    _pastryApp = app;
		    
		    node.boot(bootaddress);
		    
		    System.out.println("Starting boot into the ring");
		    // the node may require sending several messages to fully boot into the ring
		    synchronized(node) {
		      while(!node.isReady() && !node.joinFailed()) {
		        // delay so we don't busy-wait
		        node.wait(500);
		        // abort if can't join
		        if (node.joinFailed()) {
		        	System.out.println("Node join failed:");
		          throw new IOException("Could not join the FreePastry ring.  Reason:"+node.joinFailedReason()); 
		        }
		      }       
		    }
	    
	    } catch (Exception e) {
		      // remind user how to use
		      System.out.println("Usage:"); 
		      System.out.println("java [-cp FreePastry-<version>.jar] rice.tutorial.lesson3.DistTutorial localbindport bootIP bootPort");
		      System.out.println("example java rice.tutorial.DistTutorial 9001 pokey.cs.almamater.edu 9001");
		      throw e; 
	    }
	    
	    System.out.println("Finished creating new node "+_pastryNode);
   
	    LeafSet leafSet = _pastryNode.getLeafSet();
	    if(leafSet.size() == 0) {
	    	_coordinator = new Coordinator(_pastryNode, _pastryApp, this, true); //.start()
	    	_coordinator.start();
	    }
	    
	    go();
	    
	    JoinScribeMsg jm = new JoinScribeMsg(_pastryApp.endpoint.getLocalNodeHandle(), seqNum);
	    jm.setPosistion(_hero.getX(), _hero.getY(), _hero.getDirect());
	    _pastryApp.sendMulticast(jm, this.frameNumber);
	    seqNum++;
	    
	    return _pastryNode != null && _pastryApp != null;
	}