I added a median function

Try this