(define (Josephus r n)
  (define (remove-n r aantal)
    (if (= aantal 1)
        (begin
          (set-cdr! r (cddr r))
          (cdr r))
        (remove-n (cdr r) (-1+ aantal))))
  (define (while-not-1 r)
    (if (eq? (cdr r) r)
        (car r)
        (while-not-1 (remove-n r n))))
  (while-not-1 (copy-ring r)))