removed foldnestmax
added map for toggle fold method