updated cashier to use recursion and methods