Detecting and removing outliers