nmbryant wlparker Fixes median calculation