no longer using length(r)