Added median test function