fixed rdfr for files in folders und restructered luacode