This modification allows duplicate selectors to be merged

It may need recoded. If a lookup table stored all the selectors, it could be made more efficient. I may make the changes myself later.