transpose now takes generator as argument