They built a computer model to try and manage the stress on the ship as they worked to free it. It was not straightforward as the ship could have broken if they weren't extremely careful. They also had divers inspecting the hull for signs of stress. This was a massive, complex operation.