Added the ability to save folds in file
Fixed a problem with folding