fixed an error in calculating median of a vector.   Sorted median prices