Complex sentence: Twenty locomotives were built but 6 were withdrawn between 1917 and 1922, so 14 passed to the London, Midland and Scottish Railway at the grouping in 1923.
Split into simpler sentences: Twenty locomotives were built but 6 were withdrawn between 1917 and 1922. Fourteen locomotives passed to the London, Midland and Scottish Railway at the grouping in 1923.