Improve performance by using pmap.