implemented running median hvmmode