starting snapshot code