modified code of vending machine