update to direct function generation