Updated to only search correct directories when depth is greater than 2.