Implement algorithm variant using XOR operator, as advised by Alex
Update doc and test script