@Override
	public String execute(TDTDataStore data) {
		String label = getLabelName().toUpperCase();
		int taskId = getTaskID();
		String commandDetails = getCommandDetails();
		boolean isHighPriority = isHighPriority();
		TDTDateAndTime dateAndTime = getDateAndTime();

		// edit task from current label
		if (label.equals("") && taskId != -1) {
			setLabelName(data.getCurrLabel());
			ArrayList<Task> array = data.getTaskMap().get(getLabelName());
			if (taskId <= array.size() && getTaskID() > 0) {
				Task task = array.get(taskId - 1);
				return editTask(data, commandDetails, isHighPriority,
						dateAndTime, task);
			} else {
				return MESSAGE_INVALID_LABEL_TASKID;
			}
		}

		// edit task from specific label
		if (!label.equals("") && taskId != -1) {
			if (data.getTaskMap().containsKey(label)) {
				ArrayList<Task> array = data.getTaskMap().get(label);
				if (taskId <= array.size() && getTaskID() > 0) {
					Task task = array.get(taskId - 1);
					return editTask(data, commandDetails, isHighPriority,
							dateAndTime, task);
				} else {
					return MESSAGE_INVALID_LABEL_TASKID;
				}
			} else {
				return MESSAGE_INVALID_LABEL_TASKID;
			}
		}

		return MESSAGE_INVALID_COMMAND;
	}