Working on proximal_words algorithm