modified snapshot.py