I think we want to wrap all of this in a function.