(bind-func vmode
(lambda (buf:double* len:i64)
(let ((h (vsort buf len))
(p NaN) (l 0) (largest 0) (j:double 0.0) (i 0))
(dotimes (i len)
(if (= p (pref buf i))
(set! l (+ l 1)) ;; increment l
(set! l 0))
(set! p (pref buf i))
(if (> l largest)
(begin
(set! largest l)
(set! j p))))
j)))