continuing to refactor
refactoring xor stuff