correct the trandformation code to exclude very far values