multi thread version

old cost 4000 s  one time
new cost 400s  one time