change directory & sort algo