gen based on script