We should probably be able to do this if we allow a function to be passed into the generation function.