During the summer of 1872, Grant served Sandford Fleming as secretary on an exploratory journey from the Great Lakes to the Pacific Ocean in search of a route for a transcontinental railway. He kept a diary which he polished and published as Ocean to ocean.