re-order the order in which directories are built