First implementation, recursion, iteration, XOR