changed example to take snapsots every 10s
removed debug prints and added error checking to takeshapsot