working sorting selector