broke swap out into its own function