BUG: sort file list before determining spacing