working version of snapshot