Which territory was given to the US through a treaty with Spain?