get files function