public void body() throws Exception {
		//writeToLog(this.processId+"running now");
		slotNumber = 1;
		minUndecided = 1;
		while(true && this.alive) {
			PaxosMessage pMessage = getNextMessage();
			if(PaxosMessageEnum.PERFORM.equals(pMessage.getMessageType())) {
				if(pMessage.isReadMessage()) {
					performReadRequest(pMessage.getRequest());
					continue;
				}
				writeToLog(this.processId+": Received decision for slot : "+pMessage.getSlot_number());
				if(pMessage.getRequest() == null)
					writeToLog("message with null request!"+pMessage);
				decisions.put(pMessage.getSlot_number(), pMessage.getRequest());
				while(decisions.containsKey(slotNumber)) {
					Request r = decisions.get(slotNumber);
					//propose again in case the request for the slot is different from the request you proposed.
					if(proposals.containsKey(slotNumber) 
							&& !decisions.get(slotNumber).equals(proposals.get(slotNumber))) {
						propose(proposals.get(slotNumber));
					}

					//perform the current task;
					perform(r);					
				}
			} else if (PaxosMessageEnum.REQUEST.equals(pMessage.getMessageType())) {
				writeToLog(this.processId+" proposing for the request "+pMessage.getRequest());
				propose(pMessage.getRequest());	
			}			
			else {
				writeToLog("UNKNOWN message type "+pMessage.getMessageType());
			}
		}
	}