Cavalry service with General Sheridan, and life in Libby prison