private WorkerHeartbeatResponse handleHeartbeat(WorkerHeartbeat hb) {
		WorkerHeartbeatResponse response;
		
		if(hb.getTask() != null && hb.getTask().getPercentComplete() < 100) {
			parentTT.updateTaskStat(hb.getTaskId(), hb.getTask());
			//Indicates that this worker is not free
			setCurrentTask(hb.getTask());
			//The task runner should continue working on the task.
			response = new WorkerHeartbeatResponse(null, WorkerHeartbeatResponse.Cmd.POLL);
		} else if(hb.getTask() != null && hb.getTask().getPercentComplete() == 100) {
				parentTT.updateTaskStat(hb.getTaskId(), hb.getTask());
				//Indicates to task tracker that worker is free
				setCurrentTask(null);
				response = new WorkerHeartbeatResponse(null, WorkerHeartbeatResponse.Cmd.IDLE);
				System.out.println("Worker finished task " + hb.getTask().getTaskId());

		} else {
				if(getCurrentTask() != null) {
					Task t = getCurrentTask();
					System.out.println("Task Tracker " + parentTT.getId() + " Worker " +
					managerId + " starting task " + t.getTaskId());
					response = new WorkerHeartbeatResponse(t
							, WorkerHeartbeatResponse.Cmd.RUN_NEW_TASK);
				} else {
					response = new WorkerHeartbeatResponse(null, 
							WorkerHeartbeatResponse.Cmd.IDLE);
				}
		}
		return response;
	}