rewrote foldUp and unfold