Added Helper Functions for Xor