public static Map<String, GLElementGroup> loadElements(Build build, ByteBuffer vertBuf, ByteBuffer indexBuf, MaterialLoader loader, MaterialFactories materials, boolean maximize) {
		Map<String, Map<String, GLElement>> sortedElements = new HashMap<String, Map<String, GLElement>>();
		Map<String, GLElement> subElement = null;
		for (String name: build.groups.keySet()) {
			if (build.groups.get(name).isEmpty()) {
				System.err.println("loadElements: skipping empty group " + name);
				continue;
			}
			System.err.println("loadElements: loading group " + name);
			String[] nameParts = name.split("_");
			subElement = sortedElements.get(nameParts[0]);
			if (subElement == null) {
				subElement = new HashMap<String, GLElement>();
				sortedElements.put(nameParts[0], subElement);
			}
			GLMaterial material = getMaterial(build, name, materials);
			subElement.put(name, loadSingleElement(build, name, vertBuf, indexBuf, loader, material, maximize));
		}
		Map<String, GLElementGroup> groups = new HashMap<String, GLElementGroup>(sortedElements.size());
		for (String name: sortedElements.keySet()) {
			GLElement[] elems = new GLElement[sortedElements.get(name).size()];
			int idx = 0;
			for (GLElement e: sortedElements.get(name).values()) {
				elems[idx++] = e;
			}
			BoundingBox bbox = new BoundingBox(elems[0].bbox);
			for (GLElement e: elems) {
				bbox.addBox(e.bbox);
			}
			groups.put(name, new GLElementGroup(elems, bbox));
		}
		return groups;
	}