public static HashMap<String, ArrayList<HashMap<String, Object>>> bundle(ArrayList<HashMap<String, Object>> flatData) {
        HashMap<String, ArrayList<HashMap<String, Object>>> bigBox = new HashMap<String, ArrayList<HashMap<String, Object>>>();
        ArrayList<HashMap<String, Object>> experiments = new ArrayList<HashMap<String, Object>>();
        ArrayList<HashMap<String, Object>> weathers = new ArrayList<HashMap<String, Object>>();
        ArrayList<HashMap<String, Object>> soils = new ArrayList<HashMap<String, Object>>();
        ArrayList<String> foundWeathers = new ArrayList<String>();
        ArrayList<String> foundSoils = new ArrayList<String>();



        for (HashMap<String, Object> item : flatData) {
            if (item.containsKey("weather")) {
                HashMap<String, Object> w_ref = (HashMap<String, Object>) item.get("weather");
                if (w_ref.containsKey("wst_id")) {
                    String wst_id = (String) w_ref.get("wst_id");
                    if (! foundWeathers.contains(wst_id)) {
                        foundWeathers.add(wst_id);
                        weathers.add(w_ref);
                    }
                }
            }

            if (item.containsKey("soil")) {
                HashMap<String, Object> s_ref = (HashMap<String, Object>) item.get("soil");
                if (s_ref.containsKey("soil_id")) {
                    String soil_id = (String) s_ref.get("soil_id");
                    if (! foundSoils.contains(soil_id)) {
                        foundSoils.add(soil_id);
                        soils.add(s_ref);
                    }
                }
            }

            item.remove("weather");
            item.remove("soil");
            experiments.add(item);
        }
        bigBox.put("experiments", experiments);
        bigBox.put("soils", soils);
        bigBox.put("weathers", weathers);
        return bigBox;
    }