Which of the following factors contributed most directly to the end of slavery in the US?