added snapshot functionality