sorting array of pointers to avoid swapping variable length elements
moved sort files