protected Module addAnnotation(String name, Map env) 
	throws SignatureException
    {

	if (modName.op == ModuleName.ANNOTATE) {
	    return (Module)this.clone();
	}
		
	Module result = new Module(type, modName.addAnnotation(name));

	// clone module parts
	result.protectImportList = (ArrayList)(protectImportList.clone());
	result.paraModules = (ArrayList)(paraModules.clone());
	result.paraNames = (ArrayList)(paraNames.clone());	
        result.levels = this.levels;	

	// sorts
	for (int i=0; i<sorts.size(); i++) {
	    Sort sort = (Sort)sorts.elementAt(i);
	    sort = sort.addAnnotation(name, env);
	    result.addSort(sort);
	}

	// subsorts
	result.addSubsorts(subsorts.addAnnotation(name, env));

	// variable
	for (int i=0; i<vars.size(); i++) {
	    Variable var = (Variable)vars.elementAt(i);
	    var = var.addAnnotation(name, env);
	    result.addVariable(var);
	}	
	
	//operations
	for (int i=0; i<operations.size(); i++) {
	    Operation op = (Operation)operations.elementAt(i);
	    op = op.addAnnotation(name, env);
	    result.addOperation(op);
	}

	// import equations
	Iterator itor = equations.iterator();
	while (itor.hasNext()){
	    Equation eq = (Equation)itor.next();
	    eq = eq.addAnnotation(name, result, env);
	    if (!result.equations.contains(eq))
		result.addEquation(eq);
	}

        // import general equations
	itor = generalEquations.iterator();
	while (itor.hasNext()){
	    Equation eq = (Equation)itor.next();
	    eq = eq.addAnnotation(name, result, env);
	    if (!result.generalEquations.contains(eq))
		result.generalEquations.add(eq);
	}	

	if (bindings != null) {
	    result.bindings = (Hashtable)this.bindings.clone();
	}
	
	return result;
	
    }