updated visualize.py