refactored conversion filesystem to array and sorting
added recursive argument