add chosen function and main job.