added XOR and Trunk code and updated figs