fix, make temp a local variable in function sdwdate_build_median