)    if is newly updated then
()    replicate at closest location
()   else
()   estimate
()   if then
()     if is in medium or hot level at time then
()      delete from medium or hot level
()    end if
()   else if then
()  for do
()   if then
()    replicate at location
()   end if
()  end for
()  delete extra replicas of in medium or hot level
() else
()  for do
()   if then
()    replicate at location
()   end if
()  end for
()  delete extra replicas of in medium or hot level
() end if
() end if
Algorithm 1: Content replication algorithm.