changed from os.listdir to os.walk