Explain what the big loop in update_properties_all() is doing, and