Updated plotfolder function