median of two sorted array reimpl