How and why was the Canadian pacific railway completed?