Made final updates to make it work with AND instead of XOR.
Added random expression generation for testing.