refactored recipeGraph