private boolean save() {

        String name = informationPanel.getName().trim();
        String source = informationPanel.getSource().trim();
        int time = informationPanel.getTime();
        int calories = informationPanel.getCalories();
        int portions = informationPanel.getPortions();

        if ( name == null || name.equals("")){
            showErrorMessage("You need to specify a name for the recipe", "Missing Name");
            return false;
        }

        if ( portions < 0 ){
            showErrorMessage("You need to specify the number of portions for the recipe.", "Missing portions");
            return false;
        }

        Recipe newRecipe = assembleRecipe(name, time, calories, source, portions);

        List<Recipe> recipes;

        try{
            recipes = db.retrieveAllRecipes();
        } catch (DataStoreException e){
            showErrorMessage("The database contains corrupted data.\n" +
                    "You cannot continue until this is fixed.\n" +
                    "Error message: " + e.getMessage(), "Fatal Database Error");
            return false;
        }

        if(recipes.contains(newRecipe) && ! newRecipe.equals(oldRecipe)){
            showErrorMessage("There already exists an recipe with this name,\n" +
                    "please choose a new name", "Duplicate Recipe Name");
            return false;
        }
        //First time we save this recipe
        if(oldRecipe == null){
            if(db.addRecipe(newRecipe)){
                notChanged();
                oldRecipe = newRecipe;
               return true;
            } else {
                showErrorMessage("There was an error saving the recipe to the database.", "Database Error");
                return false;
            }
        } else { //This recipe has been saved before and is now being updated
            if(db.updateRecipe(oldRecipe, newRecipe)){
                notChanged();
                oldRecipe = newRecipe;
                return true;
            } else {
                showErrorMessage("There was an error saving the recipe to the database." , "Database Error");
                return false;
            }
        }
    }