private Object toValue(String name, double[] vals, Map<String, Object> parameter) {
        Object orig = parameter.get(name);
        if (orig.toString().indexOf('{') > -1) {
            // this is an array (hopefully 1dim)
            return Conversions.convert(vals, String.class);
        } else {
            return Double.toString(vals[0]);
        }
    }