Median

Hello,
I added a median function. Please review.