add median functions to merge two large lists