Who purchased the tramway in 1871