I added a median function

The pull is ready.