Hello! Maybe some one will be able to find mistake that I cannot see myself. First I read all the lines from file, then I replace every sign of new line '\n' with space. Next I enter double for loop. In first loop I check if words[i] is not null, then I assing value to first word in pair. Finally I enter inner for loop, where I check if words[i] and words[j] are not null, and then proceed with assining value to second word in pair. In the last part I check if words[i] is equal to reversed words[j]. If there is a match I assign null value to both words, if not increment i.