added a median function

Hi @gonuke, I added a median function, please let me know if you want it!
I think so