sorting out directory