It extended from the Baltimore and Ohio Railroad (B&O) junction in Morgantown in Monongalia County via Masontown, Kingwood and Rowlesburg to the M&K junction with the B&O in Preston County, a distance of 47 miles .