The time traveling duo find themselves in another cosmic mess that could unravel the space-time continuum in the final installment of the Back to the Future trilogy; this time, it's 1885 Hill Valley. Marty realizes that he must rescue Doc Brown after he receives a message that Doc was accidentally transported to 1885 and is later shot by Buford Tannen, the town outlaw and Biff's ancestor. After Marty locates the Doc, who becomes smitten with a school teacher named Clara, their mission is to speed up the DeLorean time machine to 88 mph in order to get back to 1985. They hook the DeLorean up to a locomotive, causing it to accelerate to 88 mph, transporting Marty back to 1985.