code needs to be refactored into a core module and standalone modules which wrap functions within it. xor_into has a bug.