Code used to implement a dialogue tree