debugging median