Change avg. in latency calculation to median window