Changed the MedianValue Method so that it really works!