Update Algorithm 4