Some more work. Also, this is a Scots vending machine, dammit!
Not working, but I think moving in the right direction.