added unfold wrapper, makedirs