 After another gruelling expedition in the Andes while "Beagle" was refitted he rejoined it and sailed to Lima, but found an armed insurrection in progress and had to stay with the ship.Here he was writing up his notes when he realised that Lyell's idea that coral atolls were on the rims of rising extinct volcanoes made less sense than the volcanoes gradually sinking so that the coral reefs around the island kept building themselves close to sea level and became an atoll as the volcano disappeared below.This was a theory he would examine when they reached such islands.