fixed #8 and #9 - slowness + fold transform