modified walk2.py