modified analysefolder code