transformMany function