ran some tests, added duplicate/sort function but need to optimize it

I didn't remove any of your code.

I ran some initial tests to see if it works right.

I made a better binary search function, should work faster and takes advantage of built in Python libraries like Bisect.

I'm not sure what the duplicates() method is supposed to do, but I wrote a simple function to clear the duplicates, except its slow as hell.

See my changes, discard them if you dont like them.