private byte[] put(String filename, byte[] file, boolean isFirstRun) {
		//System.out.println("put entrance");
		this.fs.getGs().getMembershipList().setMaster();
		//if you are the master you need to shard the file and send a call to the
		//other servers to save the file
		this.fs.getGs().getMembershipList().setSuccessors();
		
		if(this.fs.getGs().getMembershipList().getMember(this.fs.getGs().getProcessId()).isMaster() && isFirstRun) {
			int size = Integer.parseInt(this.fs.getGs().getProps().getProperty("shardsize"));
			List<byte[]> files = FileServerProtocol.shardFile(file, size);
			//System.out.println("Sharded into " + files.size() + " files.");
			int replicationFactor = Integer.parseInt(this.fs.getGs().getProps().getProperty("replicationfactor"));
			//append a digit to the filename then save 1 copy on the correct node
			//then store another copy on the each nodes successor
			for(int i=0;i<files.size();i++) {
				String newFile = filename + "PART_" + i;
				String sentToProcess = this.fs.getGs().getSendToProcess(newFile);
				
				//stores a copy on sentToProcess then
				//store more on each successor
				for(int j=0;j<replicationFactor;j++) {
					String hostname = this.fs.getGs().getMembershipList().getMember(sentToProcess).getIpAddress();
					int portNumber = this.fs.getGs().getMembershipList().getMember(sentToProcess).getFilePortNumber();
					//start a new socket and send the command
					Socket dlSocket;
					try {
						//System.out.println(hostname);
						//System.out.println(portNumber);
						dlSocket = new Socket(hostname, portNumber);
						byte[] command = FileServerProtocol.formCommand("put", newFile, false, files.get(i));
						BufferedOutputStream out = new BufferedOutputStream(dlSocket.getOutputStream());
						DataOutputStream dos = new DataOutputStream(out);
						//this.fs.getGs().updateBytesUsed(command.length);
						dos.writeInt(command.length);
						dos.write(command);
						out.close();
						dos.close();
						dlSocket.close();
					} catch (UnknownHostException e) {
						e.printStackTrace();
					} catch (IOException e) {
						e.printStackTrace();
					} 
					sentToProcess = this.fs.getGs().getMembershipList().getMember(sentToProcess).getSuccessor();
				}
			}
		}
		if (!isFirstRun) {
			//System.out.println("saving file");
			//the master is telling you to save a file shard
			FileOutputStream fos;
			try {
				fos = new FileOutputStream(filename);
				fos.write(file);
				LoggerThread lt = new LoggerThread(this.fs.getGs().getProcessId(), "#PUT_FILE#" + filename);
				lt.start();	 
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		//System.out.println("put finished");
		return "put finished".getBytes();
	}