Found some cases in files inside hidden directories that caused algorithm problems, putting a "cap" on the infinite loop and ignoring the hidden directories