Speed up map() with primal loop.