Reorg to function, pass filename and number of recipes.

Could be much cleaner. Sigh.