sort arrays to avoid platform specific file iteration order