I test my code different words and arrays and get correct output, but the last condition is still unreached