added a median function

Hi @gonuke, I added a median function, please let me know if you want it!
oh shoot I forgot a docstring, don't pull yet