made remove_outliers more flexible