Added snapshot code
Merge pull request #931 from akarol/snapshot-new

Added snapshot code