update r and ra