Added a function to find the median of a given list