I have 2 functions. The usedCode() function grabs orders and iterates through them to see if the coupon code was used by that user already. I extracted part of it in its