private void calculateDependentVariablesInternal(final Set<String> result, final String var) {
        if (result.contains(var)) {
            return;
        }
        result.add(var);
        final VariableState state = get(var);
        if (state != null) {
            for (String dep : state.needs) {
                calculateDependentVariablesInternal(result, dep);
            }
        }
    }
Calculates a set of all variables which are needed (directly or indirectly) to calculate the given vars
main/src/main/java/cgeo/geocaching/utils/formulas/VariableMap.java