fe = fgSet(fe, fg, 'fgfromacpc') save the fg structure inside fe structure.  

I had previously started rewriting the code to allow saving paths to file names instead of saving structures inside the fe structure. I will continue this project on a separate branch and keep the main brach as is for the moment. I improved comments as I rewrote the code here.