making an attempt to add median

I added a median function plus I added a simple test for it.