some changes in lsd sort