I introduced the struct sfound stuff to get the distances global