Added snapshot code

WIP
Can we remove this print?