Updated code for remove extremes

The code for removing extremes is up. There's an issue with composite.py
so I can't test this until then. Commented out for the time being