replacing recursive updateTransforms with iterative implementation.