extra utility functions
Xor sum implementation