implemented remedian as a streaming approximate of actual median, seems it works, but it needs an actual test on a large dataset.