add function to remove outliers, based on Ian Crossfield's