code for snapshot management

code for snapshot management. work in progress
Please try to find a way to use wait_for here instead of sleeping