Can you provide comments for these functions

suspend fun sortFiles(files: Iterable<File>): List<File> {
    val metadataReadTasks: List<Deferred<FileWithMetadata>> = withContext(Dispatchers.IO) 
 {
        files.map { file ->
            async {
                FileWithMetadata(file)
            }
        }
    }
    val metadatas: List<FileWithMetadata> = metadataReadTasks.awaitAll()
    return metadatas
        .sorted()
        .map {
            it.file
        }
}
private class FileWithMetadata(
    val file: File
) : Comparable<FileWithMetadata> {
    private val lastModified = file.lastModified()
    private val length = file.length()
    override fun compareTo(other: FileWithMetadata): Int {
        return when (other.length) {
            this.length -> other.lastModified.compareTo(this.lastModified)
            else -> other.length.compareTo(this.length)
        }
    }
}