Moved the code that adds each file's length to stats.total_size