Charles Darwin grew up with an interest in natural history, and as a student at the University of Cambridge he became a pupil and close friend of botany professor John Stevens Henslow. The year he graduated, Darwin was given a supernumerary position as a gentleman naturalist and geologist on the second voyage of HMS "Beagle", a trip that lasted five years. By the time he returned in October 1836, he had doubts about the doctrine that species were fixed and unchanging. Within months, experts informed him that specimens he had collected were separate species, not just varieties, and the patterns he saw inspired the inception of his theory of natural selection in 1838. Darwin began editing and publishing the expert reports, collected in the "Zoology of the Voyage of H.M.S. Beagle", at the same time as writing a series of books on geology, the first of which was "The Structure and Distribution of Coral Reefs". His "species work" was his "prime hobby", a background to this writing, but it evolved into an extensive research programme during the twenty years before he published his theory.