candy dispenser, no error checking, possibly buggy