pmap modified to work with any iterable