as a minor stylistic thing - i think i think it would be better if you moved this closer to where it's used at the bottom of the function