def flatten_files(directoryname,filename)
      # If the filename turns out to be a directory...
      if Dir.exist?("#{directoryname}/#{filename}")
        # do a recursive call to the parent method, unless the directory is . or ..
        directory_to_filenames("#{directoryname}/#{filename}") unless ['.','..'].include?(filename)
      else
        # Otherwise check if its actually a file and return its filepath.
        "#{directoryname}/#{filename}" if File.exists?("#{directoryname}/#{filename}")
      end
    end
def flatten_files(directoryname,filename)
      # If the filename turns out to be a directory...
      if Dir.exist?("#{directoryname}/#{filename}")
        # do a recursive call to the parent method, unless the directory is . or ..
        directory_to_filenames("#{directoryname}/#{filename}") unless ['.','..'].include?(filename)
      else
        # Otherwise check if its actually a file and return its filepath.
        "#{directoryname}/#{filename}" if File.exists?("#{directoryname}/#{filename}")
      end
    end
Expects the directory path and filename, checks to see if its another directory or filename,
 if directory, calls directory_to_filenames.