made snap-folder into a function.