implementing a snapshot-mechanism

Signed-off-by:  <st9fan@gmail.com>