Adding function generation.