(define (rmax v) (let loop ((rmax 0) (i 1)) (if (>= i (vector-length v)) rmax (loop (if (> (vector-ref v i) (vector-ref v rmax)) i rmax) (+ i 1)))))