change order of update R and update P