updated code for statistical downscaling