my implementation of os.walk