Might as well do this at the top of the function since it is needed regardless?