working on snapshot logic