whoops.
calculate median using bitwise xor