fixed findDistMod function to allow search across periodic boundaries of more than 1 cell
verified findDistMod changes