improvements in winsorization function