add fun to generate result