Tighten up median calculation.

Just return the value instead of assigning to a var.