Naive attempt at generating function from model.