changed make_foldvec function to make it more generic