use batch mapping; still slow; I'll fix this later