I'd move this block to the previous while block - only update those you need to.