A vending machine exercise