update r at beginning