changed detect sing char xor to take keys array as arg