port of the recipe generator, not tested