more advanced xor
safer init