added a function that uses fileScanner to scan from relation to index