public void intialize(){
		try{
			//store local machines IP and name
			InetAddress addr = InetAddress.getLocalHost();
			PeerInfo.local.IP = addr.getHostAddress();
			PeerInfo.local.name = addr.getHostName();
			PeerInfo.local.ID = "rmi://" + PeerInfo.local.IP + ":" + PeerInfo.rmi.port + "/share";
			System.out.println("Local RMI address is " + PeerInfo.local.ID);
			//1 means star topology, 2 means 2d mesh topology
			@SuppressWarnings("resource")
			Scanner scan = new Scanner(System.in);
			System.out.println("Enter the topology you want to use:\n1. Star topology\n2. 2D-Mesh topology");
			PeerInfo.local.Structure = scan.nextInt();
			if(PeerInfo.local.Structure == 1)
			{
				System.out.println("Star topology is used.");
				if(PeerInfo.rmi.port == 9000)
				{
					//PeerInfo.rmi.portList.length
					for(int i = 1; i < 16; i++)
						PeerInfo.local.neighborList.add("rmi://" + PeerInfo.local.IP + ":" +
								PeerInfo.rmi.portList[i] + "/share");					
				}
				else
				{
					PeerInfo.local.neighborList.add("rmi://" + PeerInfo.local.IP + ":" +
							PeerInfo.rmi.portList[0] + "/share");
				}
			}
			else if(PeerInfo.local.Structure == 2)
			{
				System.out.println("2D-Mesh topology is used.");
				
				int temp = PeerInfo.rmi.port - 9000;
				if(temp%4 != 0)
					PeerInfo.local.neighborList.add("rmi://" + PeerInfo.local.IP + ":" +
							PeerInfo.rmi.portList[temp-1] + "/share");
				if(temp%4 != 3)
					PeerInfo.local.neighborList.add("rmi://" + PeerInfo.local.IP + ":" +
							PeerInfo.rmi.portList[temp+1] + "/share");
				if(temp-4 >= 0)
					PeerInfo.local.neighborList.add("rmi://" + PeerInfo.local.IP + ":" +
							PeerInfo.rmi.portList[temp-4] + "/share");
				if(temp+4 <= 15)
					PeerInfo.local.neighborList.add("rmi://" + PeerInfo.local.IP + ":" +
							PeerInfo.rmi.portList[temp+4] + "/share");
			}
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}