public void jsonIngredientsToIngredients(){
		if (jsonIngredients == null){
			ingredients = null;
			return;
		}
		ingredients = new ArrayList<Ingredient>();
		Map<String, Integer> ingredientIds = new HashMap<String,Integer>();
		/* first add the ingredients, keeping track of the IDs */
		for(JsonIngredientWithParent jsonIngredient : jsonIngredients.getIngredientList()){
			int id = getNextIdAndIncrement();
			String name = jsonIngredient.getName();
			Ingredient i = new Ingredient(id, name);
			ingredients.add(i);
			ingredientIds.put(name, id);
		}
		
		/* then add the parents, using the fact that the generated ID is the index in the list... 
		 * TODO: fix this, it's ugly! */
		for(int i = 0; i<ingredients.size(); i++){
			for(JsonIngredient parent : jsonIngredients.getIngredientList().get(i).getParentIngredients()){
				String name = parent.getName();
				if(ingredientIds.containsKey(name)){
					int id = ingredientIds.get(name);
					ingredients.get(i).addParent(id);
				}
			}
		}
	}