Changed from script to function

Considers only cases where the number of words between gene1 and gene 2 is <=6.
Also, assumption : this is for when there are only 2 different genes in the sentence