merge lennart's changes (xor example)