added unfold, refactored(no js lint issues)