nice job abstracting this out to it's own function.