public static Stella_Object combineCaseAnswers(Vector closest, Vector scores, Vector slots) {
    scores = scores;
    if (Logic.$CASE_SOLUTION_COMBINATION$ == Logic.KWD_WEIGHTED_VOTE) {
      { PropertyList answerTable = PropertyList.newPropertyList();
        List keys = List.newList();

        { IntegerWrapper neighbor = null;
          Vector vector000 = closest;
          int index000 = 0;
          int length000 = vector000.length();

          for (;index000 < length000; index000 = index000 + 1) {
            neighbor = ((IntegerWrapper)((vector000.theArray)[index000]));
            { Stella_Object answer = (slots.theArray)[(neighbor.wrapperValue)];
              IntegerWrapper votes = ((IntegerWrapper)(answerTable.lookup(answer)));

              if (votes == null) {
                {
                  keys.push(answer);
                  answerTable.insertAt(answer, IntegerWrapper.wrapInteger(1));
                }
              }
              else {
                answerTable.insertAt(answer, IntegerWrapper.wrapInteger(votes.wrapperValue + 1));
              }
            }
          }
        }
        { int max = 0;
          Stella_Object answer = null;

          { Stella_Object key = null;
            Cons iter000 = keys.theConsList;

            for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
              key = iter000.value;
              { IntegerWrapper votes = ((IntegerWrapper)(answerTable.lookup(key)));

                if (votes.wrapperValue > max) {
                  max = votes.wrapperValue;
                  answer = key;
                }
              }
            }
          }
          return (answer);
        }
      }
    }
    else if (Logic.$CASE_SOLUTION_COMBINATION$ == Logic.KWD_WEIGHTED_AVERAGE) {
      if (Stella_Object.isaP((slots.theArray)[0], Logic.SGT_STELLA_FLOAT_WRAPPER) ||
          Stella_Object.isaP((slots.theArray)[0], Logic.SGT_STELLA_INTEGER_WRAPPER)) {
        System.out.println("Weighted average not implemented yet");
      }
      else {
        System.out.println("Warning:  Slot type not number.  Cannot average");
      }
    }
    else if (Logic.$CASE_SOLUTION_COMBINATION$ == Logic.KWD_AVERAGE) {
      { Surrogate testValue000 = Stella_Object.safePrimaryType((slots.theArray)[0]);

        if (Surrogate.subtypeOfFloatP(testValue000)) {
          { FloatWrapper sum = ((FloatWrapper)((slots.theArray)[(((IntegerWrapper)((closest.theArray)[0])).wrapperValue)]));

            { int i = Stella.NULL_INTEGER;
              int iter001 = 1;
              int upperBound000 = Logic.$NUM_NEIGHBORS$ - 1;

              for (;iter001 <= upperBound000; iter001 = iter001 + 1) {
                i = iter001;
                sum = FloatWrapper.wrapFloat(sum.wrapperValue + ((FloatWrapper)((slots.theArray)[(((IntegerWrapper)((closest.theArray)[i])).wrapperValue)])).wrapperValue);
              }
            }
            return (FloatWrapper.wrapFloat(sum.wrapperValue / Logic.$NUM_NEIGHBORS$));
          }
        }
        else if (Surrogate.subtypeOfIntegerP(testValue000)) {
          { IntegerWrapper sum = ((IntegerWrapper)((slots.theArray)[(((IntegerWrapper)((closest.theArray)[0])).wrapperValue)]));

            { int i = Stella.NULL_INTEGER;
              int iter002 = 1;
              int upperBound001 = Logic.$NUM_NEIGHBORS$ - 1;

              for (;iter002 <= upperBound001; iter002 = iter002 + 1) {
                i = iter002;
                sum = IntegerWrapper.wrapInteger(sum.wrapperValue + ((IntegerWrapper)((slots.theArray)[(((IntegerWrapper)((closest.theArray)[i])).wrapperValue)])).wrapperValue);
              }
            }
            return (FloatWrapper.wrapFloat(((double)(sum.wrapperValue)) / Logic.$NUM_NEIGHBORS$));
          }
        }
        else {
          System.out.println("Warning:  Slot type not number.  Cannot average");
        }
      }
    }
    else {
    }
    return ((slots.theArray)[(((IntegerWrapper)((closest.theArray)[0])).wrapperValue)]);
  }